export {};

// 宠物类型
interface Pet {
  name: string;
  run: () => void;
}
// 狗类型
interface Dog {
  name: string;
  run: () => void;
  age: number;
}
// 定义一个狗的实例
let dog: Dog = {
  name: '旺财',
  run: () => console.log('run'),
  age: 3,
};

// 宠物实例
let pet: Pet = dog;

console.log(pet.name);
console.log(pet.run());
